import request from '@/utils/request.js'
// const BASE_URL = "http://192.168.3.72:5389"; //测试用 
const getBaseUrl = () => uni.getStorageSync('netVal');
// 登录
export const login = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL + '/jqmk/user/login', form);
}
export const register = (form) => {
	const BASE_URL = getBaseUrl();
	return request.post(BASE_URL + '/jqmk/user/register', form)
}
//在线题库-选择题库 
export const myExam = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL + '/jqmk/exam/myExam', form)
}
//考试成绩查询
export const examAchievements = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/examRecord/main', form)
}
//在线考试
export const startExam = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/exam/startExam', form)
}
//提交试卷
export const submitJob = (form) =>  {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/examRecord/correctExam', form)
}
//题目收藏列表
export const topicCollectionList = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/collection/main', form)
} 
//收藏题目
export const collectionAdd = (form) => {
	const BASE_URL = getBaseUrl();
	return request.post(BASE_URL +'/jqmk/collection/add', form)
}
//取消收藏
export const collectionDelete = (form) => {
	const BASE_URL = getBaseUrl();
	return request.delete(BASE_URL +'/jqmk/collection/delete', form)
}
//错题集页面
export const wrongMain = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/examRecord/wrongMain', form)
}
//挑战结果查询界面主界面
export const challengeResult = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/challengeResult/main', form)
}
//查看历史成绩详情
export const viewExamDetail = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/examRecord/viewById', form)
}
//删除单个错题
export const delWrong = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/examRecord/delWrongById', form)
}
//删除该用户的全部错题
export const delWrongAll = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/examRecord/delWrongByUserId', form)
} 
//按条件对考试成绩进行查询
export const scoreSearch = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/examRecord/select', form)
}
//类别管理界面主界面，附带显示考试类别下拉
// export const categoryMain = (form) => request.get('/jqmk/category/main', form)
//显示考试名称下拉
export const viewExamName = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/examRecord/viewExamName', form)
}
//显示部门名称下拉
export const selectDeptName = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/examCrowd/selectDeptName', form)
} 
//显示工种分类下拉
export const selectJobType = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/examCrowd/selectJobType', form)
}
//显示员工姓名下拉
export const viewUsername = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/exam/viewUsername', form)
} 
//查看员工信息详情
export const portraitDetails = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/portrait/details', form)
} 
//最近7次下井的井下违规和穿戴违规数据
export const violationData = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/portrait/violationData', form)
}
//用户画像主界面
export const portraitMain = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/portrait/main', form)
} 
//违章数据表格
export const portraitTableData = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/portrait/tableData', form)
}
//分数结果排序
export const portraitSort = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/portrait/sort', form)
} 
//按条件对挑战考试成绩进行查询
export const challengeResultSelect = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/challengeResult/select', form)
}
//考试学分查询界面的主界面
export const creditMain = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/credit/main', form)
}
//按条件对学分进行查询
export const creditSelect = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/credit/select', form)
} 
//题库管理界面的主界面
export const questionbankMain = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/questionbank/main', form)
} 
//查询题库名称
export const queryBankName = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/questionbank/queryBankName', form)
}
//删除题库
export const deleteBankName = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.delete(BASE_URL +'/jqmk/questionbank/deleteBankName', form)
} 
//创建题库名称
export const createBankName = (form) => {
	const BASE_URL = getBaseUrl();
	return request.post(BASE_URL +'/jqmk/questionbank/createBankName', form)
}
//更新题库名称
export const updateBankName = (form) => {
	const BASE_URL = getBaseUrl();
	return request.post(BASE_URL +'/jqmk/questionbank/updateBankName', form)
}
//查看相应题库
export const viewQuestionBank = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/questionbank/viewQuestionBank', form)
}
//删除题库里的问题
export const delQuestion = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/questionbank/delQuestion', form)
}
//查找问题
export const selectQuestion = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/questionbank/selectQuestion', form)
} 
//更新试题
export const updateQuestion = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.post(BASE_URL +'/jqmk/questionbank/updateQuestion', form)
} 
//考试人群管理的主界面
export const examCrowdMain = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/examCrowd/main', form)
} 
//查询考试人群名称
export const selectCrowd = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/examCrowd/selectCrowd', form)
} 
//筛选考试人员姓名
export const selectPeoples = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.post(BASE_URL +'/jqmk/examCrowd/selectPeoples', form)
} 
//添加新的考试人群名称
export const examCrowdAdd = (form) => {
	const BASE_URL = getBaseUrl();
	return request.post(BASE_URL +'/jqmk/examCrowd/add', form)
}
//更新考试人群名称
export const examCrowdUpdate = (form) => {
	const BASE_URL = getBaseUrl();
	return request.post(BASE_URL +'/jqmk/examCrowd/update', form)
}
//删除考试人群名称
export const examCrowdDelete = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.delete(BASE_URL +'/jqmk/examCrowd/delete', form)
} 
//考试信息管理界面主界面
export const examMain = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/exam/main', form)
} 
//题库名称下拉
export const selectBankName = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/questionbank/selectBankName', form)
} 
//考试人群管理下拉
export const selectExamCrowd = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/exam/examCrowd', form)
} 
//根据条件查询考试
export const examSelect = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/exam/select', form)
} 
//创建试卷规则
export const examAdd = (form) => {
	const BASE_URL = getBaseUrl();
	return request.post(BASE_URL +'/jqmk/exam/add', form)
}
//更新试卷规则
export const examUpdate = (form) => {
	const BASE_URL = getBaseUrl();
	return request.post(BASE_URL +'/jqmk/exam/update', form)
}
//查看对应试卷的规则详情
export const viewExam = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/exam/viewExam', form)
} 

//挑战答题主界面
export const challengeExamMain = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/challengeExam/main', form)
} 
//创建挑战答题规则
export const challengeExamAdd = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.post(BASE_URL +'/jqmk/challengeExam/add', form)
} 
//更新挑战答题规则
export const challengeExamUpdate = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.post(BASE_URL +'/jqmk/challengeExam/update', form)
} 
//删除挑战答题规则
export const challengeExamDelete = (form) => {
	const BASE_URL = getBaseUrl();
	return request.delete(BASE_URL +'/jqmk/challengeExam/delete', form)
}
//根据条件查询
// export const challengeExamSelect = (form) => request.get('/jqmk/challengeExam/select', form)
//查看对应挑战试卷的规则详情 
export const challengeExamView = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/challengeExam/viewExam', form)
}
//获取违章类型列表 
export const violationType = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/portrait/violationType', form)
} 


// ————————————————————修改————————————————————
// ——————用户画像数据分析
// -饼图
export const porPie = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/analysis/riskPie', form)
}
// 违规占比饼图
export const violationPie = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/analysis/violationPie', form)
} 
// -折线图
export const porLine = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/analysis/riskPercent', form)
} 
// -柱状图
export const porBar = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/analysis/riskHistogram', form)
} 
// 表格
export const porTable = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/analysis/violationData', form)
} 
// ——————题库数据分析
// 考试及格率分布及考试参加人数比率 /analysis/examPeoplePie 饼
export const examPie = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/analysis/examPeoplePie', form)
} 
// 各工区考试成绩统计 /analysis/examPercentage 柱
export const deptScoreBar = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/analysis/examPercentage', form)
}
// 各工区及格率统计 /analysis/examHistogram 柱
export const deptPassBar = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/analysis/examHistogram', form)
} 
// 各考试及格率统计 /analysis/scoreHistogram 柱
export const examPassBar = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/analysis/scoreHistogram', form)
} 
// 各工区培训不合格人员分布 /analysis/annular 饼
export const deptFailPie = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/analysis/annular', form)
} 
// 各月考试平均及格率 /analysis/passRate 折线
export const examPassLine = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/analysis/passRate', form)
}
// // 表格
export const examNumTable = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/analysis/numRank', form)
} 
export const examFailTable = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/analysis/noPassList', form)
}
export const examScoreTable = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/analysis/scoreRate', form)
} 
// 标题
export const examTitle = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/analysis/title', form)
} 
// 默认考试id
export const defaultTest = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/analysis/testName', form)
} 
// 考试id下拉列表
export const getTestIdOptions = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/analysis/testId', form)
} 
// ——————基础试题库
// 查看基础试题库的所有题目
export const viewBaseBank = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/baseBank/main', form)
}
// 查看已有的题库分类
export const viewSortBank = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/questionbank/main', form)
}
//查找问题
export const selectBaseQuestion = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/baseBank/selectQuestion', form)
} 
// 添加单个试题
export const addBaseQuestion = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.post(BASE_URL +'/jqmk/questionbank/addQuestion', form)
} 
// 题目导入对应题库
export const addQuestionToBank = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/questionbank/addQuestionToBank', form)
}
// 获取已删除的试题
export const viewDel = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/baseBank/viewDel', form)
}
//删除基础题库里的问题
export const delBaseQuestion = (form) => {
	const BASE_URL = getBaseUrl();
	return request.delete(BASE_URL +'/jqmk/questionbank/deleteQuestion', form)
}
// 题库数量的统计
export const questionCount = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/baseBank/questionCount', form)
}
//评估结果查询
export const portraitSelect = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.post(BASE_URL +'/jqmk/portrait/select', form)
} 
//评估结果时间查询
export const portraitSelectByTime = (form) =>{
	const BASE_URL = getBaseUrl();
	return request.post(BASE_URL +'/jqmk/portrait/selectByTime', form)
} 

//弹窗设备穿戴数据
export const portraitWearData = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/portrait/wearData', form)
}
//弹窗违章数据+筛选
export const violateData = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/portrait/violateData', form)
}
//前三种违规穿戴比例展示
export const wearPercent = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/portrait/violaPercent', form)
}
//违章类型分析报告
export const violationReport = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/analysis/violationReport', form)
}
//读取文件夹名称列表
export const readFolder = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/file/readFolder', form)
}
//读取文件夹下文档名称
export const readDocList = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/file/readDocList', form)
}
//右下角学时显示
export const portraitHours = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/portrait/hours', form)
}
//推送高风险名单
export const rolePushList = (form) => {
	const BASE_URL = getBaseUrl();
	return request.get(BASE_URL +'/jqmk/role/pushList', form)
}